let swiperimg123 = 'https://img2.huashi6.com/images/resource/thumbnail/2023/08/11/19257_77788085265.jpg?imageMogr2/quality/75/interlace/1/thumbnail/x700/gravity/Center/crop/700x700/format/webp'

let bolent=true

Page({
    //页面的初始数据
    data:{
img:'https://img2.huashi6.com/images/resource/thumbnail/2023/08/11/19257_77788085265.jpg?imageMogr2/quality/75/interlace/1/thumbnail/x700/gravity/Center/crop/700x700/format/webp'
    },

    button1() {

        console.log('你点击我了')

        //带图标
        // wx.showToast({
        //     icon: 'error',
        //     title: '你点击了',
        // })

        //带确认和取消的按钮
        // wx.showModal({
        //   title: '你点击了我',
        //   content: '啊啊啊啊',
        //   complete: (res) => {
        //     if (res.cancel) {

        //     }

        //     if (res.confirm) {

        //     }
        //   }
        // })

        //一直转圈,用来等待的弹窗
        wx.showLoading({
            title: '你好',
        })
        setTimeout(function () {
            wx.hideLoading()
        }, 2000)
        注意

    },

    button2() {
        //这种写法时错误的
        // this.setData.img=123

        //正确写法

        
        if(bolent){
            this.setData({
                img:'https://pic.rmb.bdstatic.com/bjh/9b813c9e15f159b436833ccad8a8f7de4391.jpeg'
            })
            bolent = !bolent
        }else{
            this.setData({
                img:'https://img2.huashi6.com/images/resource/thumbnail/2023/08/11/19257_77788085265.jpg?imageMogr2/quality/75/interlace/1/thumbnail/x700/gravity/Center/crop/700x700/format/webp'
            })
            bolent = true
        }
        
    }


})